package 泛型.深入理解泛型;

import java.util.ArrayList;

/**
 * @program: algorithm
 * @description: 验证编译期检查
 * @author: 陈恩涛
 * @create: 2021-12-20 22:04
 **/
public class ComplileCheck {

    public static void main(String[] args) {
        ArrayList<String> list1 = new ArrayList();
        list1.add("aaa");
//        list1.add(111);
        System.out.println(list1.get(0).getClass());

        ArrayList list2 = new ArrayList<String>();
        list2.add("aaa");
        list2.add(1111);
        System.out.println(list2.get(0).getClass());

    }
}
